﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ThumbnailSet.aspx.cs" Inherits="GreatB2C.Web.Manage.SystemSet.SiteInfo.ThumbnailSet" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>网站信息配置</title>
    <link href="../../../App_Themes/AdminDefaultTheme/Guide.css" type="text/css" rel="stylesheet" />
    <link href="../../../App_Themes/AdminDefaultTheme/index.css" type="text/css" rel="stylesheet" />
    <link href="../../../App_Themes/AdminDefaultTheme/MasterPage.css" type="text/css" rel="stylesheet" />
    <link href="../../../App_Themes/AdminDefaultTheme/xtree.css" type="text/css" rel="stylesheet" />

    <script type="text/javascript" src="../../../Resource/Script/jquery-1.4.2.min.js"></script>

    <script src="../../../Resource/Script/jquery.validate.min.js" type="text/javascript"></script>
    
	<script type="text/javascript" src="../../../Resource/Script/iColorPicker.js"></script>
    
    <script type="text/javascript">
        $().ready(function() {
            // validate signup form on keyup and submit
            $("#form1").validate({
                rules: {
                    txtThumbsWidth: {
                        required: true
                        , digits: true
                    },
                    txtThumbsHeight: {
                        required: true
                        , digits: true
                    },
                    txtWaterMarkTextFoneSize: {
                        required: true
                        , digits: true
                    },
                    txtWaterMarkTextFoneBorder: {
                        required: true
                        , digits: true
                    },
                    txtWaterMarketTextPositionX: {
                        required: true
                        , digits: true
                    },
                    txtWaterMarketTextPositionY: {
                        required: true
                        , digits: true
                    },
                    txtWaterMarkPercent: {
                        required: true
                        , digits: true
                    },
                    txtWaterMarkThumbPercent: {
                        required: true
                        , digits: true
                    },
                    txtTransparence: {
                        required: true
                        , digits: true
                    },
                    txtWaterMarkImagePositionX: {
                        required: true
                        , digits: true
                    },
                    txtWaterMarkImagePositionY: {
                        required: true
                        , digits: true
                    }
                },
                messages: {
                    txtThumbsWidth: {
                        required: "<font class='validatemsg'>* 请输入缩略图默认宽度</font>"
                        , digits: "<font class='validatemsg'>* 请输入正整数</font>"
                    },
                    txtThumbsHeight: {
                        required: "<font class='validatemsg'>* 请输入缩略图默认高度</font>"
                        , digits: "<font class='validatemsg'>* 请输入正整数</font>"
                    },
                    txtWaterMarkTextFoneSize: {
                        required: "<font class='validatemsg'>* 请输入文字大小</font>"
                        , digits: "<font class='validatemsg'>* 请输入正整数</font>"
                    },
                    txtWaterMarkTextFoneBorder: {
                        required: "<font class='validatemsg'>* 请输入文字边框大小</font>"
                        , digits: "<font class='validatemsg'>* 请输入正整数</font>"
                    },
                    txtWaterMarketTextPositionX: {
                        required: "<font class='validatemsg'>* 请输入X坐标</font>"
                        , digits: "<font class='validatemsg'>* 请输入正整数</font>"
                    },
                    txtWaterMarketTextPositionY: {
                        required: "<font class='validatemsg'>* 请输入Y坐标</font>"
                        , digits: "<font class='validatemsg'>* 请输入正整数</font>"
                    },
                    txtWaterMarkPercent: {
                        required: "<font class='validatemsg'>* 请输入水印图片缩小比例</font>"
                        , digits: "<font class='validatemsg'>* 请输入正整数</font>"
                    },
                    txtWaterMarkThumbPercent: {
                        required: "<font class='validatemsg'>* 请输入水印图片缩小比例</font>"
                        , digits: "<font class='validatemsg'>* 请输入正整数</font>"
                    },
                    txtTransparence: {
                        required: "<font class='validatemsg'>* 请输入水印图片透明度</font>"
                        , digits: "<font class='validatemsg'>* 请输入正整数</font>"
                    },
                    txtWaterMarkImagePositionX: {
                        required: "<font class='validatemsg'>* 请输入X坐标</font>"
                        , digits: "<font class='validatemsg'>* 请输入正整数</font>"
                    },
                    txtWaterMarkImagePositionY: {
                        required: "<font class='validatemsg'>* 请输入Y坐标</font>"
                        , digits: "<font class='validatemsg'>* 请输入正整数</font>"
                    }
                }
            });
            
        });

        function ShowTabWaterMark(type) {
            if (type == "0") {
                document.getElementById('TextWaterMark').style.display = "";
                document.getElementById('PicWaterMark').style.display = "none";
            }
            else {
                document.getElementById('TextWaterMark').style.display = "none";
                document.getElementById('PicWaterMark').style.display = "";
            }
        }

        function show(obj) {
            if (obj.value == "AutoSet") {
                $("#wmp").css("display", "none");
            }
            else {
                $("#wmp").css("display", "block");
            }
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <table width="100%" border="0" cellpadding="2" cellspacing="1" class="border">
        <tr align="center">
            <td colspan="2" class="spacingtitle">
                <strong>缩略图参数配置</strong>
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft" style="width: 30%">
                <strong>缩略图默认宽度：</strong>
            </td>
            <td>
                <asp:TextBox ID="txtThumbsWidth" TextMode="SingleLine" runat="server" CssClass="inputtext"
                    Width="100px" onfocus="this.style.backgroundColor='#d2e0f0';" onblur="this.style.backgroundColor='';"></asp:TextBox>像素&nbsp;&nbsp;设为0时，将以高度为准按比例缩小。
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft">
                <strong>缩略图默认高度：</strong>
            </td>
            <td>
                <asp:TextBox ID="txtThumbsHeight" TextMode="SingleLine" runat="server" CssClass="inputtext"
                    Width="100px" onfocus="this.style.backgroundColor='#d2e0f0';" onblur="this.style.backgroundColor='';"></asp:TextBox>像素&nbsp;&nbsp;设为0时，将以宽度为准按比例缩小。
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft">
                <strong>缩略图算法：</strong>
            </td>
            <td>
                <asp:RadioButtonList ID="radThumbsMode" runat="server">
                    <asp:ListItem Value="1">
                                常规算法：宽度和高度都大于0时，直接缩小成指定大小，其中一个为0时，按比例缩小
                    </asp:ListItem>
                    <asp:ListItem Value="2">
                                裁剪法：宽度和高度都大于0时，先按最佳比例缩小再裁剪成指定大小，其中一个为0时，按比例缩小。
                    </asp:ListItem>
                    <asp:ListItem Value="3">
                                补充法：在指定大小的背景图上附加上按最佳比例缩小的图片。
                    </asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft">
                <strong>缩略图底色：</strong>
            </td>
            <td>
                <input id="txtBgColor" name="txtBgColor" type="text" maxlength="7" value="#ffcc00" class="inputtext iColorPicker" runat="server" />
                使用补充算法时将以此设置的背景色填充。
            </td>
        </tr>
        <tr class="tdbg">
            <td class="tdbgleft">
                <strong>水印类型：</strong>
            </td>
            <td>
                <input id="radText" name="radWaterMarkType" value="0" onclick="ShowTabWaterMark(this.value)"
                    type="radio" runat="server" />文字水印
                <input id="radImage" name="radWaterMarkType" value="1" onclick="ShowTabWaterMark(this.value)"
                    type="radio" runat="server" />图片水印
            </td>
        </tr>
        <tbody id="TextWaterMark" runat="server" style="display: none;">
            <tr class="tdbg">
                <td class="tdbgleft">
                    <strong>水印文字：</strong><br />
                    水印文字字数不宜超过15个字符，不支持HTML标记。
                </td>
                <td>
                    <asp:TextBox ID="txtWaterMarkText" runat="server" CssClass="inputtext" Width="400px"
                        onfocus="this.style.backgroundColor='#d2e0f0';" onblur="this.style.backgroundColor='';"></asp:TextBox>
                </td>
            </tr>
            <tr class="tdbg">
                <td class="tdbgleft">
                    <strong>文字字体：</strong>
                </td>
                <td>
                    <asp:DropDownList ID="ddlWaterMarkTextFoneType" runat="server">
                        <asp:ListItem Value="宋体" Selected="True">宋体</asp:ListItem>
                        <asp:ListItem Value="楷体_GB2312">楷体</asp:ListItem>
                        <asp:ListItem Value="仿宋_GB2312">新宋体</asp:ListItem>
                        <asp:ListItem Value="黑体">黑体</asp:ListItem>
                        <asp:ListItem Value="隶书">隶书</asp:ListItem>
                        <asp:ListItem Value="幼圆">幼圆</asp:ListItem>
                        <asp:ListItem Value="Andale Mono">Andale Mono</asp:ListItem>
                        <asp:ListItem Value="Arial">Arial</asp:ListItem>
                        <asp:ListItem Value="Arial Black">Arial Black</asp:ListItem>
                        <asp:ListItem Value="Book Antiqua">Book Antiqua</asp:ListItem>
                        <asp:ListItem Value="Century Gothic">Century Gothic</asp:ListItem>
                        <asp:ListItem Value="Comic Sans MS">Comic Sans MS</asp:ListItem>
                        <asp:ListItem Value="Courier New">Courier New</asp:ListItem>
                        <asp:ListItem Value="Georgia">Georgia</asp:ListItem>
                        <asp:ListItem Value="Impact">Impact</asp:ListItem>
                        <asp:ListItem Value="Tahoma">Tahoma</asp:ListItem>
                        <asp:ListItem Value="Times New Roman">Times New Roman</asp:ListItem>
                        <asp:ListItem Value="Trebuchet MS">Trebuchet MS</asp:ListItem>
                        <asp:ListItem Value="Script MT Bold">Script MT Bold</asp:ListItem>
                        <asp:ListItem Value="Stencil">Stencil</asp:ListItem>
                        <asp:ListItem Value="Verdana">Verdana</asp:ListItem>
                        <asp:ListItem Value="Lucida Console">Lucida Console</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr class="tdbg">
                <td class="tdbgleft">
                    <strong>字体样式：</strong>
                </td>
                <td>
                    <asp:DropDownList ID="DropWaterMarkTextFoneStyle" runat="server">
                        <asp:ListItem Value="Bold">加粗</asp:ListItem>
                        <asp:ListItem Value="Italic">倾斜</asp:ListItem>
                        <asp:ListItem Value="Regular" Selected="True">常规</asp:ListItem>
                        <asp:ListItem Value="Strikeout">中间有直线通过</asp:ListItem>
                        <asp:ListItem Value="Underline">带下划线</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr class="tdbg">
                <td class="tdbgleft">
                    <strong>文字大小：</strong>
                </td>
                <td>
                    <asp:TextBox ID="txtWaterMarkTextFoneSize" Text="16" runat="server" MaxLength="3"
                        CssClass="inputtext" Width="100px" onfocus="this.style.backgroundColor='#d2e0f0';"
                        onblur="this.style.backgroundColor='';"></asp:TextBox>
                </td>
            </tr>
            <tr class="tdbg">
                <td class="tdbgleft">
                    <strong>文字颜色：</strong>
                </td>
                <td>
                    <input id="txtWaterMarkTextFoneColor" name="txtWaterMarkTextFoneColor" type="text" value="#ffcc00" maxlength="7" class="inputtext iColorPicker" runat="server" />
                </td>
            </tr>
            <tr class="tdbg">
                <td class="tdbgleft">
                    <strong>文字边框大小：</strong><br />
                </td>
                <td>
                    <asp:TextBox ID="txtWaterMarkTextFoneBorder" Text="1" runat="server" MaxLength="3"
                        CssClass="inputtext" Width="100px" onfocus="this.style.backgroundColor='#d2e0f0';"
                        onblur="this.style.backgroundColor='';"></asp:TextBox>
                    设置为0时没有边框
                </td>
            </tr>
            <tr class="tdbg">
                <td class="tdbgleft">
                    <strong>文字边框颜色：</strong>
                </td>
                <td>
                    <input id="txtWaterMarkTextFoneBorderColor" name="txtWaterMarkTextFoneBorderColor" type="text" value="#ffcc00" maxlength="7" class="inputtext iColorPicker" runat="server" />
                </td>
            </tr>
            <tr class="tdbg">
                <td class="tdbgleft">
                    <strong>坐标起点位置：</strong><br />
                </td>
                <td>
                    <asp:DropDownList ID="DropWaterMarkTextPosition" runat="server">
                        <asp:ListItem Value="WM_TOP_LEFT" Selected="True">左上</asp:ListItem>
                        <asp:ListItem Value="WM_TOP_RIGHT">右上</asp:ListItem>
                        <asp:ListItem Value="WM_BOTTOM_RIGHT">右下</asp:ListItem>
                        <asp:ListItem Value="WM_BOTTOM_LEFT">左下</asp:ListItem>
                        <asp:ListItem Value="WM_SetByManual">手动设置</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr class="tdbg">
                <td class="tdbgleft">
                    <strong>坐标位置：</strong><br />
                    坐标起点位置设置为手动设置时才有效。
                </td>
                <td>
                    X:<asp:TextBox ID="txtWaterMarketTextPositionX" Text="0" runat="server" CssClass="inputtext"
                        Width="70px" onfocus="this.style.backgroundColor='#d2e0f0';" onblur="this.style.backgroundColor='';"></asp:TextBox>像素
                    <br />
                    Y:<asp:TextBox ID="txtWaterMarketTextPositionY" Text="0" runat="server" CssClass="inputtext"
                        Width="70px" onfocus="this.style.backgroundColor='#d2e0f0';" onblur="this.style.backgroundColor='';"></asp:TextBox>像素
                </td>
            </tr>
        </tbody>
        <tbody id="PicWaterMark" runat="server" style="display: none;">
            <tr class="tdbg">
                <td class="tdbgleft">
                    <strong>水印图片文件名：</strong><br />
                    这里请填写图片文件的相对路径。
                </td>
                <td>
                    <asp:TextBox ID="txtWaterMarkImagePath" runat="server" CssClass="inputtext" Width="400px"
                        onfocus="this.style.backgroundColor='#d2e0f0';" onblur="this.style.backgroundColor='';"></asp:TextBox>
                </td>
            </tr>
            <tr class="tdbg">
                <td class="tdbgleft">
                    <strong>水印图片缩小比例：</strong>
                </td>
                <td>
                    <table border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td>
                                当水印图片宽度或高度大于要加水印图片的1/<asp:TextBox ID="txtWaterMarkPercent" Text="4" runat="server"
                                    CssClass="inputtext" Width="70px" onfocus="this.style.backgroundColor='#d2e0f0';"
                                    onblur="this.style.backgroundColor='';"></asp:TextBox>时，按
                            </td>
                            <td>
                                <asp:DropDownList ID="DropWaterMarkPercent" runat="server" onchange="show(this);">
                                    <asp:ListItem Value="AutoSet">自动计算值</asp:ListItem>
                                    <asp:ListItem Value="ManualSet">手动设置值</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                            <td id="wmp" width="80px" style="display:none;">
                                <asp:Label ID="lblWaterMarkPercent" runat="server" Text="1" Style="float:left;"></asp:Label>/
                                <asp:TextBox ID="txtWaterMarkThumbPercent" Text="10" runat="server"
                                    CssClass="inputtext" Width="50px" onfocus="this.style.backgroundColor='#d2e0f0';"
                                    onblur="this.style.backgroundColor='';"></asp:TextBox>
                            </td>
                            <td>
                                比例缩小。
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr class="tdbg">
                <td class="tdbgleft">
                    <strong>水印图片透明度：</strong>
                </td>
                <td>
                    <asp:TextBox ID="txtTransparence" Text="30" runat="server" CssClass="inputtext" Width="100px"
                        onfocus="this.style.backgroundColor='#d2e0f0';" onblur="this.style.backgroundColor='';"></asp:TextBox>%，0为完全透明，100为完全不透明
                </td>
            </tr>
            <tr class="tdbg">
                <td class="tdbgleft">
                    <strong>坐标起点位置：</strong><br />
                </td>
                <td>
                    <asp:DropDownList ID="DropWaterMarkImagePosition" runat="server">
                        <asp:ListItem Value="WM_TOP_LEFT" Selected="True">左上</asp:ListItem>
                        <asp:ListItem Value="WM_TOP_RIGHT">右上</asp:ListItem>
                        <asp:ListItem Value="WM_BOTTOM_RIGHT">右下</asp:ListItem>
                        <asp:ListItem Value="WM_BOTTOM_LEFT">左下</asp:ListItem>
                        <asp:ListItem Value="WM_SetByManual">手动设置</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr class="tdbg">
                <td class="tdbgleft">
                    <strong>坐标位置：</strong><br />
                    坐标起点位置设置为手动设置时才有效。
                </td>
                <td>
                    X：<asp:TextBox ID="txtWaterMarkImagePositionX" Text="0" runat="server" CssClass="inputtext"
                        Width="50px" onfocus="this.style.backgroundColor='#d2e0f0';" onblur="this.style.backgroundColor='';"></asp:TextBox>像素
                    <br />
                    Y：<asp:TextBox ID="txtWaterMarkImagePositionY" Text="0" runat="server" CssClass="inputtext"
                        Width="50px" onfocus="this.style.backgroundColor='#d2e0f0';" onblur="this.style.backgroundColor='';"></asp:TextBox>像素
                </td>
            </tr>
        </tbody>
        <tr class="tdbgbottom">
            <td colspan="2">
                <asp:Button ID="BtnSubmit" runat="server" Text="保存设置[S]" class="btnstyle_blue" Style="width: 90px;"
                    AccessKey="S" onmouseover="this.className='btnstyle_blue_over'" onmouseout="this.className='btnstyle_blue'"
                    OnClick="BtnSubmit_Click" />&nbsp;&nbsp;
                <input type="reset" name="ClearSiteInfo" value="重 填[R]" class="btnstyle_blue" id="btnSiteInfoReset" accesskey="R" style="width:70px;"
                    runat="server" onmouseover="this.className='btnstyle_blue_over'" onmouseout="this.className='btnstyle_blue'" />
            </td>
        </tr>
        <tr class="tdbg">
            <td colspan="2" style="align: left;">
                <span style="color: Blue">注：修改缩略图或水印的配置后请到附件管理、上传文件管理处重新生成缩略图或水印！</span>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
